import { Tools } from 'weaver-mobile';
import { catchApiError, PARAMS } from '../util/index';


/*************** 与我相关 ***************/
// 与我相关菜单
export const discussRecord = params => {
	let options = {
		method: 'GET',
		url: '/api/cowork/view/discussRecord',
		params: {...PARAMS, ...params}
	};
	return Tools.callApi(options).then(catchApiError);
}


/*************** 收藏的帖子 ***************/
export const getCoworkCollectList = params => {
	let options = {
		method: 'GET',
		url: '/api/cowork/collect/getCoworkCollectList',
		params: {...PARAMS, ...params}
	};
	return Tools.callApi(options).then(catchApiError);
}

// 协作-协作交流-置顶/取消置顶/审批/收藏/删除评论/赞 交流记录
export const coworkDiscussOperation = params => {
	let options = {
		method: 'POST',
		url: '/api/cowork/base/coworkDiscussOperation',
		params: {...PARAMS, ...params}
	};
	return Tools.callApi(options).then(catchApiError);
}
/* *************************** 主题监控 ****************************** */
// 主题监控-列表
export const getCoworkItemMonitorList = params => {
	let options = {
		method: 'GET',
		url: '/api/cowork/itemMonitor/getCoworkItemMonitorList',
		params: {...PARAMS, ...params}
	};
	return Tools.callApi(options).then(catchApiError);
}

// 主题监控-置顶
export const batchCoworkItemMonitorTop = params => {
	let options = {
		method: 'POST',
		url: '/api/cowork/itemMonitor/batchCoworkItemMonitorTop',
		params: {...PARAMS, ...params}
	};
	return Tools.callApi(options).then(catchApiError);
}

// 主题监控-取消置顶
export const batchCoworkItemMonitorCancelTop = params => {
	let options = {
		method: 'POST',
		url: '/api/cowork/itemMonitor/batchCoworkItemMonitorCancelTop',
		params: {...PARAMS, ...params}
	};
	return Tools.callApi(options).then(catchApiError);
}

// 主题监控-结束
export const batchCoworkItemMonitorEnd = params => {
	let options = {
		method: 'POST',
		url: '/api/cowork/itemMonitor/batchCoworkItemMonitorEnd',
		params: {...PARAMS, ...params}
	};
	return Tools.callApi(options).then(catchApiError);
}

// 主题监控-打开
export const coworkItemOperation = params => {
	let options = {
		method: 'POST',
		url: '/api/cowork/base/coworkItemOperation',
		params: {...PARAMS, ...params}
	};
	return Tools.callApi(options).then(catchApiError);
}

// 主题监控-删除
export const batchCoworkItemMonitorDel = params => {
	let options = {
		method: 'POST',
		url: '/api/cowork/itemMonitor/batchCoworkItemMonitorDel',
		params: {...PARAMS, ...params}
	};
	return Tools.callApi(options).then(catchApiError);
}




/* *************************** 内容监控 ****************************** */
// 内容监控-列表
export const getCoworkDiscussMonitorList = params => {
	let options = {
		method: 'GET',
		url: '/api/cowork/discussMonitor/getCoworkDiscussMonitorList',
		params: {...PARAMS, ...params}
	};
	return Tools.callApi(options).then(catchApiError);
}

// 内容监控-删除
export const batchDiscussDel = params => {
	let options = {
		method: 'POST',
		url: '/api/cowork/discussApproval/batchDiscussDel',
		params: {...PARAMS, ...params}
	};
	return Tools.callApi(options).then(catchApiError);
}

export const getCoworkCounts = params => {
	let options = {
		method: 'GET',
		url: '/api/cowork/base/getCoworkCounts',
		params: {...PARAMS, ...params}
	};
	return Tools.callApi(options).then(catchApiError);
}

export const getUserInfo = params => {
	let options = {
		method: 'GET',
		url: '/api/cowork/base/getUserInfo',
		params: {...PARAMS, ...params}
	};
	return Tools.callApi(options).then(catchApiError);
}

/* *************************** 评论监控 ****************************** */

// 评论监控-列表
export const getCoworkCommentMonitorList = params => {
	let options = {
		method: 'GET',
		url: '/api/cowork/commentMonitor/getCoworkCommentMonitorList',
		params: {...PARAMS, ...params}
	};
	return Tools.callApi(options).then(catchApiError);
}

// 评论监控-删除
export const batchCommentMonitorDel = params => {
	let options = {
		method: 'POST',
		url: '/api/cowork/commentMonitor/batchCommentMonitorDel',
		params: {...PARAMS, ...params}
	};
	return Tools.callApi(options).then(catchApiError);
}


/* *************************** 我的发表 ****************************** */
		/* *********************** 我的帖子 ***************** */
export const getCoworkMineList = params => {
	let options = {
		method: 'GET',
		url: '/api/cowork/mine/getCoworkMineList',
		params: {...PARAMS, ...params}
	};
	return Tools.callApi(options).then(catchApiError);
}
